<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="author" content="Ajj">
    <title>下拉菜单</title>
    <script src="jquery-3.1.1.js"></script>
    <style>
        html,body{
            height: 100%;
        }
        body{
            margin: 0;
            text-align: center;
        }
        div{
            display: inline-block;
            width: 100px;
            position: absolute;
            left: 300px;
            top: 100px;
            border-bottom: 1px solid lightgray;
        }
        #d2{
            left: 400px;
        }
        #d3{
            left: 500px;
        }
        #d4{
            left: 600px;
        }
        p{
            background-color: gray;
            height: 40px;
            padding: 0;
            margin: 0;
            line-height: 40px;
            color: white;
            cursor: pointer;
        }
        div li{
            list-style-type: none;
            width: 100px;
            background-color: white;
            padding: 0;
            margin: 0;
            height: 40px;
            line-height: 40px;
            border-left: 1px solid lightgray;
            border-right: 1px solid lightgray;
            display: none;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div id="d1">
        <p>公司简介</p>
        <li>公司简介</li>
        <li>公司简介</li>
        <li>公司简介</li>
    </div>
    <div id="d2">
        <p>产品介绍</p>
        <li>产品介绍</li>
        <li>产品介绍</li>
        <li>产品介绍</li>
    </div>
    <div id="d3">
        <p>联系我们</p>
        <li>联系我们</li>
        <li>联系我们</li>
        <li>联系我们</li>
    </div>
    <div id="d4">
        <p>人才招聘</p>
        <li>人才招聘</li>
        <li>人才招聘</li>
        <li>人才招聘</li>
    </div>
</body>
</html>
<script>
    $('div').mouseover(function(){
        $(this).children('li').show();
        $(this).siblings().children('li').hide();
        
        $(this).children().hover(function(){
            $(this).css('text-decoration','underline');
        },function(){
            $(this).css('text-decoration','none');
        });
    });

    $('div').mouseout(function(){
        $(this).children('li').hide();
    });

    $('p').hover(function(){
        $(this).css('color','orange');
    },function(){
        $(this).css('color','white');
    });
</script>